package com.cj.demo6.controller;

import com.cj.demo6.pojo.Order_form;
import com.cj.demo6.service.Order_formService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "/Order_form-订单管理")
@RequestMapping(value = "/order_form")
@RestController
public class Order_formController {
    @Autowired
    Order_formService order_formService;
    @GetMapping("/selectAll")
    @ResponseBody
    @ApiOperation("查询所有用户")
    public List<Order_form> selectALL(){
        return order_formService.selectAll();
    }

    @GetMapping("/insert")
    @ResponseBody
    @ApiOperation("插入新数据")
    public int insert(Order_form order_form){
        return order_formService.insert(order_form);
    }

    @GetMapping("/update")
    @ResponseBody
    @ApiOperation("修改数据")
    public int update(Order_form order_form){
        return order_formService.update(order_form);
    }

    @GetMapping("/delete")
    @ResponseBody
    @ApiOperation("删除数据")
    public int delete(@RequestParam("dId") int dId){
        return order_formService.delete(dId);
    }

    @GetMapping("/deletes")
    @ResponseBody
    @ApiOperation("批量删除数据")
    public int deletes(@RequestParam("dId") int[] dIds){
        return order_formService.deletes(dIds);
    }

    @GetMapping("/selectMapper")
    @ResponseBody
    @ApiOperation("查询所有用户接口")
    public List<Order_form> selectMapper(Order_form order_form){
        return order_formService.selectMapper(order_form);
    }
}
